const path = require('path');
// 自动生成html模板并动态加载生产的xxx.bundle.js
const HtmlWebpackPlugin = require('html-webpack-plugin');
// 每次打包时清空指定文件夹
const { CleanWebpackPlugin } = require("clean-webpack-plugin");

module.exports = {
	mode: 'development',
	// context 默认为项目根目录, 即path.resolve(__dirname, '../')
	context: path.resolve(__dirname, '../'), // 基础目录，绝对路径，用于从配置中解析入口起点(entry point)和 loader
	entry: './src/entrys/entry1.js',
	output: {
		filename: 'entry1.js',
		path: path.resolve(__dirname, '../dists/dist1'),
		publicPath: '/'	// 执行npm run server时用'/', 其他用'./'
	}
}